<%-- 
    Document   : regPatient
    Created on : 2016-8-2, 11:20:25
    Author     : 52461
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title><%=DataConfig.getInstance().getConfig().get("systemName")%></title>
        <link rel="icon" href="${base}/favicon.ico" type="image/x-icon">
        <link href="${base}/css/bootstrap-paper.css" rel="stylesheet">
        <link href="${base}/css/font-awesome.css" rel="stylesheet">
        <link href="${base}/css/datepicker3.css" rel="stylesheet">

        <script type="text/javascript" src="${base}/js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="${base}/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="${base}/js/angular/angular.min.js"></script>
        <script type="text/javascript" src="${base}/js/jquery.cxhd.js"></script>
        <script type="text/javascript" src="${base}/js/bootstrap-datepicker.js"></script>
        <script type="text/javascript" src="${base}/js/bootstrap-datepicker.zh-CN.js"></script>
    </head>
    <body ng-app="reg" ng-controller="mainCtrl" style="padding-top: 10px; font-family: 微软雅黑">
        <div class="container">
            <div class="row">
                <div class="panel panel-default">
                    <div class="panel-heading">
                         <strong><span class="glyphicon glyphicon-th"></span>&nbsp;&nbsp;病人登记</strong>
                    </div>
                    <div class="panel-body">
                        <form name ="users" class="form-horizontal">
                            <div class="col-lg-12 col-md-12">
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label for="name" class="col-sm-4 control-label">病人名字</label>
                                        <div class="col-sm-8">
                                            <input ng-model="user.name" id="name" type="text" class="form-control" required="">
                                        </div>
                                    </div>
                                </div>
                                 <div class="col-lg-6">
                                    <div class="form-group">
                                        <label  class="col-sm-4 control-label">性别</label>
                                        <div class="col-sm-8" style="padding-top: 7px;">
                                            <input ng-model="user.sex" value="女" type="radio" required="" > 女
                                            <input ng-model="user.sex" value="男" type="radio" required="" > 男
                                        </div>
                                    </div>
                                </div>
                                 <div class="col-lg-6">
                                    <div class="form-group">
                                        <label for="" class="col-sm-4 control-label">年龄</label>
                                        <div class="col-sm-8">
                                            <input ng-model="user.age" type="text" required="" class="form-control">
                                        </div>
                                    </div>
                                </div>
                                 <div class="col-lg-6">
                                    <div class="form-group">
                                        <label for="sureTime" class="col-sm-4 control-label">生日</label>
                                        <div class="col-sm-8">
                                            <input id="datePick" ng-model="user.birth"  type="text" class="form-control">
                                        </div>
                                    </div>
                                </div>
                                 <div class="col-lg-6">
                                    <div class="form-group">
                                        <label for="sureTime" class="col-sm-4 control-label">手机号</label>
                                        <div class="col-sm-8">
                                              <input id="datePick" ng-model="user.phone" type="text" class="form-control">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label for="sureTime" class="col-sm-4 control-label">职业</label>
                                        <div class="col-sm-8">
                                              <input id="datePick" ng-model="user.professional" type="text" class="form-control">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label for="" class="col-sm-4 control-label">身高</label>
                                        <div class="col-sm-8">
                                              <input id="datePick" ng-model="user.height" type="text" class="form-control">
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="col-lg-6">
                                    <div class="form-group">
                                        <label for="" class="col-sm-4 control-label">体重</label>
                                        <div class="col-sm-8">
                                              <input id="datePick" ng-model="user.weight" type="text" class="form-control">
                                        </div>
                                    </div>
                                </div>
                                 <div class="col-lg-12">
                                    <div class="form-group">
                                        <label for="" class="col-sm-4 col-md-2 control-label">家庭地址</label>
                                        <div class="col-sm-8 col-md-10">
                                              <input id="datePick" ng-model="user.address" type="text" class="form-control">
                                        </div>
                                    </div>
                                </div>
                            </div>                           

                        </form>
                    </div>
                    <div class="panel-footer" style="text-align: right">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button  ng-click="saveUser()" ng-disabled="users.$invalid" type="button" class="btn btn-primary"><span class="fa fa-save"></span>&nbsp;&nbsp;保存</button>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>
<script>
    
    angular.module("reg",[])
            .controller("mainCtrl",function($scope){
                
                $scope.saveUser = function(){
                    
                    $.post("patInfo/saveInfo",$scope.user,function(data){
                        if(data=="true"){
                            steveAl("保存成功");
                            $scope.$apply();
                            
                        }
                    })
                    
                }
            })
</script>
